[mirrors]
http://rephial.org/downloads/3.5/angband-v3.5.0.tar.gz

[vars]
filesize=20907673
sha512=7400d567f11946286062121f3f677617b819d66ea354dade63ef49fb2f2a85ed6bad4d9474ff5fa7710a7866d65b537e604623e4a986e36ca06088ca0bded96c
desc="nethack-style dungeon exploration game, optional with graphics"

[deps]
curses

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
cat << EOF > ncursesw5-config
#!/bin/sh
echo -lcurses -lterminfo
EOF
chmod +x ncursesw5-config
CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  ac_cv_path_NCURSES_CONFIG=./ncursesw5-config

#prevent environment leakage breaking the build
sed -i 's/MKPATH=/CONFIG=\nMKPATH=/' Makefile

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
mv "$dest"/games "$dest"/bin
